﻿namespace System.ServiceModel.DomainServices
{
    using System;
    using System.Runtime.CompilerServices;

    [AttributeUsage(AttributeTargets.Class, AllowMultiple=false, Inherited=true)]
    public class DomainIdentifierAttribute : Attribute
    {
        private string _name;

        public DomainIdentifierAttribute(string name)
        {
            this._name = name;
        }

        public bool IsApplicationService { get; set; }

        public string Name
        {
            get
            {
                if (string.IsNullOrEmpty(this._name))
                {
                    throw new InvalidOperationException("Name cannot be null.");
                }
                return this._name;
            }
            internal set
            {
                this._name = value;
            }
        }
    }
}

